package com.netty.protobuf.server;

//import com.netty.protobuf.MyDataInfo;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * Created by Administrator on 2018/11/1/001.
 */
public class TestServerProtoHandler extends SimpleChannelInboundHandler<Object> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
//        MyDataInfo.Message.DataType dataType = msg.getDataType();
//        if (dataType == MyDataInfo.Message.DataType.PersonType) {
//            MyDataInfo.Person p = msg.getPerson();
//            System.out.println(p.getName() + "==" + p.getEmail() + "===>" + p.getId());
//        }
//        if (dataType == MyDataInfo.Message.DataType.DogType) {
//            MyDataInfo.Dog dog = msg.getDog();
//            System.out.println(dog.getName() + "==" + dog.getAge());
//        }
//        if (dataType == MyDataInfo.Message.DataType.CatType) {
//            MyDataInfo.Cat cat = msg.getCat();
//            System.out.println(cat.getName() + "==" + cat.getCity());
//        }


    }
}
